<?php

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

function __autoload($class)
{
    $paths = config::get('require.paths');
    foreach ($paths as $path) {
        $filename = $path
            . $class
            . config::get('php.file.class.extension');

        if (file_exists($filename)) {
            require_once $filename; 
            return;
        }
    }
    die("failed to load $class in <strong>$filename</strong>" . var_export($paths, true));
}

?>
